/*
 * Proxy pattern provides a surrogate or placeholder for another object to control access to it. The pattern has structural purpose
 * and applies to objects.
 * whenever there is a need for a more versatile or sophisticated reference to an object than a simple pointer
 */

#ifndef _CPP_DESIGN_PATTERN_PROXY_H
#define _CPP_DESIGN_PATTERN_PROXY_H

#include <iostream>

class Subject
{
public:
    virtual ~Subject() {}
    virtual void request() = 0;
};

class RealSubject : public Subject
{
public:
    void request();
};

class Proxy : public Subject
{
public:
    Proxy();
    ~Proxy();

    void request();

private:
    RealSubject *subject;
};

#endif